//******* BEGIN LICENSE BLOCK *****
// Version: MPL 1.1
//
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
//
// The Original Code is ZhangHongBing (HongBing75@gmail.com)
//
// The Initial Developer of the Original Code is 
//        ZhangHongBing (HongBing75@gmail.com)
//
// Portions created by the Initial Developer are Copyright (C) 2007
// the Initial Developer. All Rights Reserved.
//
// Contributor(s):
//
// ***** END LICENSE BLOCK *****/



#ifndef _CONVVIEW_H__
#define _CONVVIEW_H__

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "WSPopView.h"
#include "IOView.h"


class CAppView : public CWSPopView  
{
public:
	bool          m_Created;
	CIOView       m_IOView;
public:
	CAppView();
	virtual ~CAppView();
   
	virtual void    Layout(bool Redraw =true);
	virtual LRESULT Reaction(UINT message, WPARAM wParam, LPARAM lParam);

	string GetName(){ return m_IOView.m_Name;};
	void   SetName(const char* Name){
		assert(Name != NULL);
		m_Text = Name;
        m_IOView.m_Name = Name;
	};

	void SetNerve(Nerve* n){
		m_IOView.m_Nerve = n;
	};
	void SetID(int64 ID){
		m_ID = ID;
		m_IOView.m_ID = ID;
	}
	int64 GetID(){ return m_IOView.m_ID;};



protected:
	LRESULT OnLButtonDown(WPARAM wParam, LPARAM lParam);
    LRESULT OnCreate(WPARAM wParam, LPARAM lParam); 
};

#define  ID_ADDTHREAD    ID_CLOSE   
#define  CM_ADDCONV      200

class  AddConvBnt : public CSpace2{
public:
	COLORREF  m_crBorder;
	COLORREF  m_crNormal;
	COLORREF  m_crFocused;
	COLORREF  m_crSelected;
	
	bool      m_IsDock;
	
	AddConvBnt(int64 ID,
		COLORREF crBorder,
		COLORREF crNormal,
		COLORREF crFocused,
		COLORREF crSelected);
	virtual ~AddConvBnt(){};
	virtual void Draw(HDC hDC);     
};


#endif // !defined(_CONVVIEW_H__)
